home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / dvx / inc / x11 / xaw / asciisrc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  4.9 KB  |  191 lines

  1. /*
  2.  * $XConsortium: AsciiSrc.h,v 1.5 89/10/05 13:17:30 kit Exp $
  3.  *
  4.  * Copyright 1989 Massachusetts Institute of Technology
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and its
  7.  * documentation for any purpose and without fee is hereby granted, provided
  8.  * that the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of M.I.T. not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  M.I.T. makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  */
  17.  
  18.  
  19. /*
  20.  * AsciiSrc.h - Public Header file for Ascii Text Source.
  21.  *
  22.  * This is the public header file for the Ascii Text Source.
  23.  * It is intended to be used with the Text widget, the simplest way to use
  24.  * this text source is to use the AsciiText Object.
  25.  *
  26.  * Date:    June 29, 1989
  27.  *
  28.  * By:      Chris D. Peterson
  29.  *          MIT X Consortium 
  30.  *          kit@expo.lcs.mit.edu
  31.  */
  32.  
  33.  
  34. #ifndef _XawAsciiSrc_h
  35. #define _XawAsciiSrc_h
  36.  
  37. #include <X11/Xaw/TextSrc.h>
  38.  
  39. /* Resources:
  40.  
  41.  Name             Class        RepType        Default Value
  42.  ----             -----        -------        -------------
  43.  
  44.  
  45. */
  46.  
  47. /* Class record constants */
  48.  
  49. extern WidgetClass asciiSrcObjectClass;
  50.  
  51. typedef struct _AsciiSrcClassRec *AsciiSrcObjectClass;
  52. typedef struct _AsciiSrcRec      *AsciiSrcObject;
  53.  
  54. /*
  55.  * Just to make people's lives a bit easier.
  56.  */
  57.  
  58. #define AsciiSourceObjectClass AsciiSrcObjectClass
  59. #define AsciiSourceObject      AsciiSrcObject
  60.  
  61. /*
  62.  * Resource Definitions.
  63.  */
  64.  
  65. #define XtCDataCompression "DataCompression"
  66. #define XtCPieceSize "PieceSize"
  67. #define XtCType "Type"
  68. #define XtCUseStringInPlace "UseStringInPlace"
  69.  
  70. #define XtNdataCompression "dataCompression"
  71. #define XtNpieceSize "pieceSize"
  72. #define XtNtype "type"
  73. #define XtNuseStringInPlace "useStringInPlace"
  74.  
  75. #define XtRAsciiType "AsciiType"
  76.  
  77. #define XtEstring "string"
  78. #define XtEfile "file"
  79.  
  80. typedef enum _XawAsciiType {XawAsciiFile, XawAsciiString} XawAsciiType; /* Added tag. POHC 91/04/08 */
  81.  
  82. /************************************************************
  83.  *
  84.  * Public routines 
  85.  *
  86.  ************************************************************/
  87.  
  88. /*    Function Name: XawAsciiSourceFreeString
  89.  *    Description: Frees the string returned by a get values call
  90.  *                   on the string when the source is of type string.
  91.  *    Arguments: w - the AsciiSrc object.
  92.  *    Returns: none.
  93.  */
  94.  
  95. void XawAsciiSourceFreeString(/* w */);
  96. /*
  97. Widget w;
  98. */
  99.  
  100. /*    Function Name: XawAsciiSave
  101.  *    Description: Saves all the pieces into a file or string as required.
  102.  *    Arguments: w - the asciiSrc Object.
  103.  *    Returns: TRUE if the save was successful.
  104.  */
  105.  
  106. Boolean XawAsciiSave(/* w */);
  107. /*
  108. Widget w;
  109. */
  110.  
  111. /*    Function Name: XawAsciiSaveAsFile
  112.  *    Description: Save the current buffer as a file.
  113.  *    Arguments: w - the asciiSrc object.
  114.  *                 name - name of the file to save this file into.
  115.  *    Returns: True if the save was sucessful.
  116.  */
  117.  
  118. Boolean XawAsciiSaveAsFile(/* w, name */);
  119. /*
  120. Widget w;
  121. String name;
  122. */
  123.  
  124. /*    Function Name: XawAsciiSourceChanged
  125.  *    Description: Returns true if the source has changed since last saved.
  126.  *    Arguments: w - the asciiSource object.
  127.  *    Returns: a Boolean (see description).
  128.  */
  129.  
  130. Boolean XawAsciiSourceChanged(/* w */);
  131. /*
  132. Widget w;
  133. */
  134.  
  135. #ifdef XAW_BC
  136. /*************************************************************
  137.  *
  138.  * These functions are only preserved for compatability.     
  139.  */
  140.  
  141. #define ASCII_STRING        /* Turn on R3 AsciiDisk and AsciiString */
  142. #define ASCII_DISK        /* Emulation modes. */
  143.  
  144. #ifdef ASCII_STRING
  145. #define XawStringSourceDestroy XtDestroyWidget
  146. #endif
  147.  
  148. #ifdef ASCII_DISK
  149. #define XawDiskSourceDestroy XtDestroyWidget
  150. #endif
  151.  
  152. #ifdef ASCII_STRING
  153. /*    Function Name: AsciiStringSourceCreate
  154.  *    Description: Creates a string source.
  155.  *    Arguments: parent - the widget that will own this source.
  156.  *                 args, num_args - the argument list.
  157.  *    Returns: a pointer to the new text source.
  158.  */
  159.  
  160. Widget XawStringSourceCreate(/* parent, args, num_args */);
  161. /*
  162. Widget parent;
  163. ArgList args;
  164. Cardinal num_args;
  165. */
  166. #endif /* ASCII_STRING */
  167.  
  168. #ifdef ASCII_DISK
  169. /*    Function Name: AsciiDiskSourceCreate
  170.  *    Description: Creates a disk source.
  171.  *    Arguments: parent - the widget that will own this source.
  172.  *                 args, num_args - the argument list.
  173.  *    Returns: a pointer to the new text source.
  174.  */
  175.  
  176. Widget XawDiskSourceCreate(/* parent, args, num_args */);
  177. /*
  178. Widget parent;
  179. ArgList args;
  180. Cardinal num_args;
  181. */
  182. #endif /* ASCII_DISK */
  183. #endif /* XAW_BC */
  184. /*
  185.  * End of Compatability stuff.
  186.  *  
  187.  ***************************************************/
  188.  
  189. #endif /* _XawAsciiSrc_h  - Don't add anything after this line. */
  190.  
  191.